Skip to content

Conversation

@Illviljan
Copy link
Contributor

@Illviljan Illviljan commented May 21, 2023

Following recommendation from: #7824 (comment)

# main:
a = tuple(f"dim_{i}" for i in range(500))
%timeit OrderedSet(a)
46 µs ± 2.26 µs per loop (mean ± std. dev. of 7 runs, 10000 loops each)

# This PR:
a = tuple(f"dim_{i}" for i in range(500))
%timeit OrderedSet(a)
28.9 µs ± 476 ns per loop (mean ± std. dev. of 7 runs, 10000 loops each)

@Illviljan Illviljan added run-benchmark Run the ASV benchmark workflow topic-performance labels May 21, 2023
@Illviljan Illviljan mentioned this pull request May 21, 2023
6 tasks
Copy link
Collaborator

@mathause mathause left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we are 3.9+ I think we could now do

self._d =| dict.fromkeys(values)

but no need to update.

@Illviljan Illviljan added the plan to merge Final call for comments label May 24, 2023
@Illviljan Illviljan merged commit 95bb813 into pydata:main May 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

plan to merge Final call for comments run-benchmark Run the ASV benchmark workflow topic-performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants